
	  function animate(obj, json, speed, callback){
		  	    clearInterval(obj.timer);
				obj.timer = setInterval(function(){
					var flag = true;
					for(var attr in json){
					var current = parseInt(getStyle(obj,attr));
				    var step = (json[attr] - current) / 10;
					 step = step > 0 ? Math.ceil(step) : Math.floor(step);
					 obj.style[attr] = current + step +'px';
					if(current != json[attr]){
						flag = false;
					}
				}
				  if(flag){
				  	clearInterval(obj.timer);
				  	if(callback && typeof callback == 'function'){ //验证callback是否传递，传递的话看是否是函数类型
				  	  callback();
				  	}
				  }
				},speed);
			}
    